/*
 * Copyright (c) 2013 Tah Wei Hoon.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Apache License Version 2.0,
 * with full text available at http://www.apache.org/licenses/LICENSE-2.0.html
 *
 * This software is provided "as is". Use at your own risk.
 */
package com.myopicmobileX.textwarrior.common;

/**
 * Singleton class containing the symbols and operators of the Javascript language
 */
public class LanguageLuaJava extends Language {
	private static Language _theOne = null;
	
	//private final static String functionTarget   = "_ENV|_G|_VERSION|assert|collectgarbage|coroutine|create|isyieldable|resume|running|status|wrap|yield|debug|gethook|getinfo|getlocal|getmetatable|getregistry|getupvalue|getuservalue|sethook|setlocal|setmetatable|setupvalue|setuservalue|traceback|upvalueid|upvaluejoin|dofile|error|getfenv|getmetatable|io|close|flush|input|lines|open|output|popen|read|stderr|stdin|stdout|tmpfile|type|write|ipairs|load|loadfile|loadstring|luajava|bindClass|clear|coding|createArray|createProxy|instanceof|loadLib|loaded|luapath|new|newInstance|package|math|abs|acos|asin|atan|atan2|ceil|cos|cosh|deg|exp|floor|fmod|frexp|huge|ldexp|log|log10|max|maxinteger|min|mininteger|modf|pi|pow|rad|random|randomseed|sin|sinh|sqrt|tan|tanh|tointeger|type|ult|module|next|os|clock|date|difftime|execute|exit|getenv|remove|rename|setlocale|time|tmpname|package|config|cpath|loaded|loaders|loadlib|path|preload|searchers|searchpath|seeall|pairs|pcall|print|rawequal|rawget|rawlen|rawset|require|select|setfenv|setmetatable|string|byte|char|dump|find|format|gfind|gmatch|gsub|len|lower|match|pack|packsize|rep|reverse|sub|unpack|upper|table|concat|foreach|foreachi|insert|maxn|move|pack|remove|sort|unpack|tonumber|tostring|type|unpack|char|charpattern|utf8|codepoint|codes|len|offset|xpcall";
	//private final static String functionTarget   = "_ENV|_G|_VERSION|assert|collectgarbage|coroutine.create|coroutine.isyieldable|coroutine.resume|coroutine.running|coroutine.status|coroutine.wrap|coroutine.yield|debug.debug|debug.gethook|debug.getinfo|debug.getlocal|debug.getmetatable|debug.getregistry|debug.getupvalue|debug.getuservalue|debug.sethook|debug.setlocal|debug.setmetatable|debug.setupvalue|debug.setuservalue|debug.traceback|debug.upvalueid|debug.upvaluejoin|dofile|error|getfenv|getmetatable|io.close|io.flush|io.input|io.lines|io.open|io.output|io.popen|io.read|io.stderr|io.stdin|io.stdout|io.tmpfile|io.type|io.write|ipairs|load|loadfile|loadstring|luajava.bindClass|luajava.clear|luajava.coding|luajava.createArray|luajava.createProxy|luajava.instanceof|luajava.loadLib|luajava.loaded|luajava.luapath|luajava.new|luajava.newInstance|luajava.package|math.abs|math.acos|math.asin|math.atan|math.atan2|math.ceil|math.cos|math.cosh|math.deg|math.exp|math.floor|math.fmod|math.frexp|math.huge|math.ldexp|math.log|math.log10|math.max|math.maxinteger|math.min|math.mininteger|math.modf|math.pi|math.pow|math.rad|math.random|math.randomseed|math.sin|math.sinh|math.sqrt|math.tan|math.tanh|math.tointeger|math.type|math.ult|module|next|os.clock|os.date|os.difftime|os.execute|os.exit|os.getenv|os.remove|os.rename|os.setlocale|os.time|os.tmpname|package.config|package.cpath|package.loaded|package.loaders|package.loadlib|package.path|package.preload|package.searchers|package.searchpath|package.seeall|pairs|pcall|print|rawequal|rawget|rawlen|rawset|require|select|setfenv|setmetatable|string.byte|string.char|string.dump|string.find|string.format|string.gfind|string.gmatch|string.gsub|string.len|string.lower|string.match|string.pack|string.packsize|string.rep|string.reverse|string.sub|string.unpack|string.upper|table.concat|table.foreach|table.foreachi|table.insert|table.maxn|table.move|table.pack|table.remove|table.sort|table.unpack|tonumber|tostring|type|unpack|utf8.char|utf8.charpattern|utf8.codepoint|utf8.codes|utf8.len|utf8.offset|xpcall";
	private final static String CkeywordsTarget ="#|include|char|double|float|int|long|short|void|auto|const|extern|register|static|volatile|signed|unsigned|sizeof|typedef|enum|struct|union|break|case|continue|default|do|else|for|goto|if|return|switch|while";
	private final static String LuakeywordsTarget ="and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while|activity|import";
	private final static String JavaKeywordsTarget="void|boolean|byte|char|short|int|long|float|double|strictfp|import|package|new|class|interface|extends|implements|enum|public|private|protected|static|abstract|final|native|volatile|assert|try|throw|throws|catch|finally|instanceof|super|this|if|else|for|do|while|switch|case|default|continue|break|return|synchronized|transient|true|false|null|method|field";
	private final static String XmlKeywordsTarget="-|<|>|/|?|xml|version|string|style|color|id|item|resources|dimen|path|menu|application|uses|sdk|permission|intent|filter|manifest|xmlns|intent|action|sevice|category|shape|data|receiver|service|meta";
	
	private final static String globalTarget="__add|__band|__bnot|__bor|__bxor|__call|__concat|__div|__eq|__idiv|__index|__le|__len|__lt|__mod|__mul|__newindex|__pow|__shl|__shr|__sub|__unm|_ENV|_G|assert|collectgarbage|dofile|error|findtable|getmetatable|ipairs|load|loadfile|loadstring|module|next|pairs|pcall|print|rawequal|rawget|rawlen|rawset|require|select|self|setmetatable|tointeger|tonumber|tostring|type|unpack|xpcall";
	
	private final static String packageName="coroutine|debug|io|luajava|math|os|package|string|table|utf8";
	private final static String package_coroutine = "create|isyieldable|resume|running|status|wrap|yield";
	private final static String package_debug = "debug|gethook|getinfo|getlocal|getmetatable|getregistry|getupvalue|getuservalue|sethook|setlocal|setmetatable|setupvalue|setuservalue|traceback|upvalueid|upvaluejoin";
	private final static String package_io = "close|flush|input|lines|open|output|popen|read|stderr|stdin|stdout|tmpfile|type|write";
	private final static String package_luajava = "astable|bindClass|clear|coding|createArray|createProxy|instanceof|loadLib|loaded|luapath|new|newInstance|package|tostring";
	private final static String package_math = "abs|acos|asin|atan|atan2|ceil|cos|cosh|deg|exp|floor|fmod|frexp|huge|ldexp|log|log10|max|maxinteger|min|mininteger|modf|pi|pow|rad|random|randomseed|sin|sinh|sqrt|tan|tanh|tointeger|type|ult";
	private final static String package_os = "clock|date|difftime|execute|exit|getenv|remove|rename|setlocale|time|tmpname";
	private final static String package_package = "config|cpath|loaded|loaders|loadlib|path|preload|searchers|searchpath|seeall";
	private final static String package_string = "byte|char|dump|find|format|gfind|gmatch|gsub|len|lower|match|pack|packsize|rep|reverse|sub|unpack|upper";
	private final static String package_table = "concat|foreach|foreachi|insert|maxn|move|pack|remove|sort|unpack";
	private final static String package_utf8 = "char|charpattern|codepoint|codes|len|offset";
//--	private final static String activity_method = "addContentView(|applyOverrideConfiguration(|assertRuntimeOverlayThemable(|assetsToSD(|autofillCallbackAuthenticate(|autofillCallbackRequestHideFillUi(|autofillCallbackRequestShowFillUi(|autofillCallbackResetableStateAvailable(|bindService(|bindService(|bindService(|bindService(|bindServiceAsUser(|bindServiceAsUser(|call(|call(|canLoadUnsafeResources(|canStartActivityForResult(|checkCallingOrSelfPermission(|checkCallingOrSelfUriPermission(|checkCallingPermission(|checkCallingUriPermission(|checkPermission(|checkPermission(|checkSelfPermission(|checkUriPermission(|checkUriPermission(|checkUriPermission(|clearWallpaper(|closeContextMenu(|closeOptionsMenu(|convertFromTranslucent(|convertToTranslucent(|createApplicationContext(|createConfigurationContext(|createContextForSplit(|createCredentialProtectedStorageContext(|createDeviceProtectedStorageContext(|createDisplayContext(|createPackageContext(|createPackageContextAsUser(|createPendingResult(|databaseList(|deleteDatabase(|deleteFile(|deleteSharedPreferences(|dismissDialog(|dismissKeyboardShortcutsHelper(|dispatchEnterAnimationComplete(|dispatchGenericMotionEvent(|dispatchKeyEvent(|dispatchKeyShortcutEvent(|dispatchPopulateAccessibilityEvent(|dispatchTouchEvent(|dispatchTrackballEvent(|doAsset(|doFile(|doFile(|doString(|dump(|enforceCallingOrSelfPermission(|enforceCallingOrSelfUriPermission(|enforceCallingPermission(|enforceCallingUriPermission(|enforcePermission(|enforceUriPermission(|enforceUriPermission(|enterPictureInPictureMode(|enterPictureInPictureMode(|enterPictureInPictureMode(|enterPictureInPictureModeIfPossible(|equals(|exitFreeformMode(|fileList(|findViewByAutofillIdTraversal(|findViewById(|findViewsByAutofillIdTraversal(|finish(|finish(|finishActivity(|finishActivityFromChild(|finishAffinity(|finishAfterTransition(|finishAndRemoveTask(|finishFromChild(|get(|getActionBar(|getActivity(|getActivityToken(|getApplication(|getApplicationContext(|getApplicationInfo(|getAssets(|getBaseContext(|getBasePackageName(|getCacheDir(|getCallingActivity(|getCallingPackage(|getChangingConfigurations(|getClass(|getClassLoader(|getClassLoaders(|getCodeCacheDir(|getColor(|getColorStateList(|getComponentName(|getContentResolver(|getContentResolverForUser(|getContentScene(|getContentTransitionManager(|getContext(|getCurrentFocus(|getDataDir(|getDatabasePath(|getDecorView(|getDir(|getDisplay(|getDisplayAdjustments(|getDrawable(|getExternalCacheDir(|getExternalCacheDirs(|getExternalFilesDir(|getExternalFilesDirs(|getExternalMediaDirs(|getFileStreamPath(|getFilesDir(|getFragmentManager(|getGlobalData(|getHeight(|getIApplicationThread(|getIntent(|getInterceptor(|getLastNonConfigurationInstance(|getLayoutInflater(|getLibrarys(|getLoaderManager(|getLocalClassName(|getLocalDir(|getLuaCpath(|getLuaDir(|getLuaDir(|getLuaExtDir(|getLuaExtDir(|getLuaExtPath(|getLuaExtPath(|getLuaLpath(|getLuaPath(|getLuaPath(|getLuaPath(|getLuaState(|getMainLooper(|getMainThreadHandler(|getMaxNumPictureInPictureActions(|getMediaController(|getMenuInflater(|getNextAutofillId(|getNoBackupFilesDir(|getObbDir(|getObbDirs(|getOpPackageName(|getOptionsMenu(|getOverrideConfiguration(|getPackageCodePath(|getPackageManager(|getPackageName(|getPackageResourcePath(|getParent(|getParentActivityIntent(|getPreferences(|getPreloadsFileCache(|getReferrer(|getRequestedOrientation(|getResources(|getSearchEvent(|getServiceDispatcher(|getSharedData(|getSharedData(|getSharedPreferences(|getSharedPreferences(|getSharedPreferencesPath(|getSharedPrefsFile(|getString(|getString(|getSystemService(|getSystemService(|getSystemServiceName(|getTaskId(|getText(|getTheme(|getThemeResId(|getTitle(|getTitleColor(|getUserId(|getViewVisibility(|getVoiceInteractor(|getVolumeControlStream(|getWallpaper(|getWallpaperDesiredMinimumHeight(|getWallpaperDesiredMinimumWidth(|getWidth(|getWindow(|getWindowManager(|getWindowStackId(|grantUriPermission(|hasWindowFocus(|hashCode(|invalidateOptionsMenu(|isActivityTransitionRunning(|isBackgroundVisibleBehind(|isChangingConfigurations(|isChild(|isCredentialProtectedStorage(|isDestroyed(|isDeviceProtectedStorage(|isFinishing(|isImmersive(|isInMultiWindowMode(|isInPictureInPictureMode(|isLocalVoiceInteractionSupported(|isOverlayWithDecorCaptionEnabled(|isRestricted(|isResumed(|isTaskRoot(|isVisibleForAutofill(|isVoiceInteraction(|isVoiceInteractionRoot(|loadBitmap(|loadDex(|loadLib(|loadResources(|managedQuery(|managedQuery(|moveDatabaseFrom(|moveSharedPreferencesFrom(|moveTaskToBack(|navigateUpTo(|navigateUpToFromChild(|newActivity(|newActivity(|newActivity(|newActivity(|newActivity(|newActivity(|newActivity(|newActivity(|newActivity(|newActivity(|newActivity(|newActivity(|newActivity(|newActivity(|newActivity(|newActivity(|newTask(|newTask(|newTask(|newThread(|newThread(|newTimer(|newTimer(|notify(|notifyAll(|obtainStyledAttributes(|obtainStyledAttributes(|obtainStyledAttributes(|obtainStyledAttributes(|onActionModeFinished(|onActionModeStarted(|onActivityReenter(|onAttachFragment(|onAttachedToWindow(|onBackPressed(|onBackgroundVisibleBehindChanged(|onConfigurationChanged(|onContentChanged(|onContextItemSelected(|onContextMenuClosed(|onCreate(|onCreate(|onCreateContextMenu(|onCreateDescription(|onCreateNavigateUpTaskStack(|onCreateOptionsMenu(|onCreatePanelMenu(|onCreatePanelView(|onCreateThumbnail(|onCreateView(|onCreateView(|onDetachedFromWindow(|onEdgeTouchEvent(|onEnterAnimationComplete(|onGenericMotionEvent(|onKeyDown(|onKeyLongPress(|onKeyMultiple(|onKeyShortcut(|onKeyUp(|onLocalVoiceInteractionStarted(|onLocalVoiceInteractionStopped(|onLowMemory(|onMenuItemSelected(|onMenuOpened(|onMovedToDisplay(|onMultiWindowModeChanged(|onMultiWindowModeChanged(|onNavigateUp(|onNavigateUpFromChild(|onNewActivityOptions(|onOptionsItemSelected(|onOptionsMenuClosed(|onPanelClosed(|onPictureInPictureModeChanged(|onPictureInPictureModeChanged(|onPointerCaptureChanged(|onPostCreate(|onPrepareNavigateUpTaskStack(|onPrepareOptionsMenu(|onPreparePanel(|onProvideAssistContent(|onProvideAssistData(|onProvideKeyboardShortcuts(|onProvideReferrer(|onReceive(|onRequestPermissionsResult(|onRestoreInstanceState(|onRetainNonConfigurationInstance(|onSaveInstanceState(|onSearchRequested(|onSearchRequested(|onStateNotSaved(|onTouchEvent(|onTrackballEvent(|onTrimMemory(|onUserInteraction(|onVisibleBehindCanceled(|onWindowAttributesChanged(|onWindowDismissed(|onWindowFocusChanged(|onWindowStartingActionMode(|onWindowStartingActionMode(|openContextMenu(|openFileInput(|openFileOutput(|openOptionsMenu(|openOrCreateDatabase(|openOrCreateDatabase(|overridePendingTransition(|peekWallpaper(|postponeEnterTransition(|push(|push(|readAsset(|recreate(|regGc(|registerComponentCallbacks(|registerForContextMenu(|registerReceiver(|registerReceiver(|registerReceiver(|registerReceiver(|registerReceiver(|registerReceiver(|registerReceiver(|registerReceiverAsUser(|releaseInstance(|removeDialog(|removeStickyBroadcast(|removeStickyBroadcastAsUser(|reportFullyDrawn(|requestDragAndDropPermissions(|requestPermissions(|requestShowKeyboardShortcuts(|requestVisibleBehind(|requestWindowFeature(|result(|revokeUriPermission(|revokeUriPermission(|runFunc(|runOnUiThread(|sendBroadcast(|sendBroadcast(|sendBroadcast(|sendBroadcast(|sendBroadcastAsUser(|sendBroadcastAsUser(|sendBroadcastAsUser(|sendBroadcastAsUser(|sendBroadcastMultiplePermissions(|sendError(|sendMsg(|sendOrderedBroadcast(|sendOrderedBroadcast(|sendOrderedBroadcast(|sendOrderedBroadcast(|sendOrderedBroadcastAsUser(|sendOrderedBroadcastAsUser(|sendOrderedBroadcastAsUser(|sendStickyBroadcast(|sendStickyBroadcastAsUser(|sendStickyBroadcastAsUser(|sendStickyOrderedBroadcast(|sendStickyOrderedBroadcastAsUser(|set(|setActionBar(|setContentTransitionManager(|setContentView(|setContentView(|setContentView(|setContentView(|setContentView(|setContentView(|setContentView(|setDebug(|setDefaultKeyMode(|setDisablePreviewScreenshots(|setDummyTranslucent(|setEnterSharedElementCallback(|setExitSharedElementCallback(|setFeatureDrawable(|setFeatureDrawableAlpha(|setFeatureDrawableResource(|setFeatureDrawableUri(|setFinishOnTouchOutside(|setImmersive(|setIntent(|setMediaController(|setOverlayWithDecorCaptionEnabled(|setPersistent(|setPictureInPictureArgs(|setPictureInPictureParams(|setProgress(|setProgressBarIndeterminate(|setProgressBarIndeterminateVisibility(|setProgressBarVisibility(|setRequestedOrientation(|setResult(|setResult(|setSecondaryProgress(|setSharedData(|setTaskDescription(|setTheme(|setTitle(|setTitle(|setTitleColor(|setVisible(|setVolumeControlStream(|setVrModeEnabled(|setWallpaper(|setWallpaper(|shouldShowRequestPermissionRationale(|shouldUpRecreateTask(|showAssist(|showDialog(|showDialog(|showLockTaskEscapeMessage(|showToast(|startActionMode(|startActionMode(|startActivities(|startActivities(|startActivitiesAsUser(|startActivity(|startActivity(|startActivityAsCaller(|startActivityAsUser(|startActivityAsUser(|startActivityAsUserFromFragment(|startActivityForResult(|startActivityForResult(|startActivityForResult(|startActivityForResultAsUser(|startActivityForResultAsUser(|startActivityForResultAsUser(|startActivityFromChild(|startActivityFromChild(|startActivityFromFragment(|startActivityFromFragment(|startActivityIfNeeded(|startActivityIfNeeded(|startForegroundService(|startForegroundServiceAsUser(|startInstrumentation(|startIntentSender(|startIntentSender(|startIntentSenderForResult(|startIntentSenderForResult(|startIntentSenderFromChild(|startIntentSenderFromChild(|startIntentSenderFromChildFragment(|startLocalVoiceInteraction(|startLockTask(|startManagingCursor(|startNextMatchingActivity(|startNextMatchingActivity(|startPostponedEnterTransition(|startSearch(|startService(|startService(|startService(|startService(|startService(|startServiceAsUser(|stopLocalVoiceInteraction(|stopLockTask(|stopManagingCursor(|stopService(|stopServiceAsUser(|takeKeyEvents(|toString(|triggerSearch(|unZipAssets(|unbindService(|unregisterComponentCallbacks(|unregisterForContextMenu(|unregisterReceiver(|updateDisplay(|wait(|wait(|wait(|handler|luaCpath|luaDir|status|DEFAULT_KEYS_DIALER|DEFAULT_KEYS_DISABLE|DEFAULT_KEYS_SEARCH_GLOBAL|DEFAULT_KEYS_SEARCH_LOCAL|DEFAULT_KEYS_SHORTCUT|DONT_FINISH_TASK_WITH_ACTIVITY|FINISH_TASK_WITH_ACTIVITY|FINISH_TASK_WITH_ROOT_ACTIVITY|RESULT_CANCELED|RESULT_FIRST_USER|RESULT_OK|ACCESSIBILITY_SERVICE|ACCOUNT_SERVICE|ACTIVITY_SERVICE|ALARM_SERVICE|APPWIDGET_SERVICE|APP_OPS_SERVICE|AUDIO_SERVICE|AUTOFILL_MANAGER_SERVICE|BACKUP_SERVICE|BATTERY_SERVICE|BIND_ABOVE_CLIENT|BIND_ADJUST_WITH_ACTIVITY|BIND_ALLOW_OOM_MANAGEMENT|BIND_ALLOW_WHITELIST_MANAGEMENT|BIND_AUTO_CREATE|BIND_DEBUG_UNBIND|BIND_EXTERNAL_SERVICE|BIND_FOREGROUND_SERVICE|BIND_FOREGROUND_SERVICE_WHILE_AWAKE|BIND_IMPORTANT|BIND_IMPORTANT_BACKGROUND|BIND_NOT_FOREGROUND|BIND_NOT_VISIBLE|BIND_SHOWING_UI|BIND_TREAT_LIKE_ACTIVITY|BIND_VISIBLE|BIND_WAIVE_PRIORITY|BLUETOOTH_SERVICE|CAMERA_SERVICE|CAPTIONING_SERVICE|CARRIER_CONFIG_SERVICE|CLIPBOARD_SERVICE|COMPANION_DEVICE_SERVICE|CONNECTIVITY_SERVICE|CONSUMER_IR_SERVICE|CONTEXTHUB_SERVICE|CONTEXT_CREDENTIAL_PROTECTED_STORAGE|CONTEXT_DEVICE_PROTECTED_STORAGE|CONTEXT_IGNORE_SECURITY|CONTEXT_INCLUDE_CODE|CONTEXT_REGISTER_PACKAGE|CONTEXT_RESTRICTED|COUNTRY_DETECTOR|DEVICE_IDENTIFIERS_SERVICE|DEVICE_IDLE_CONTROLLER|DEVICE_POLICY_SERVICE|DISPLAY_SERVICE|DOWNLOAD_SERVICE|DROPBOX_SERVICE|ETHERNET_SERVICE|FINGERPRINT_SERVICE|GATEKEEPER_SERVICE|HARDWARE_PROPERTIES_SERVICE|HDMI_CONTROL_SERVICE|INCIDENT_SERVICE|INPUT_METHOD_SERVICE|INPUT_SERVICE|IPSEC_SERVICE|JOB_SCHEDULER_SERVICE|KEYGUARD_SERVICE|LAUNCHER_APPS_SERVICE|LAYOUT_INFLATER_SERVICE|LOCATION_POLICY_SERVICE|LOCATION_SERVICE|MEDIA_PROJECTION_SERVICE|MEDIA_ROUTER_SERVICE|MEDIA_SESSION_SERVICE|MIDI_SERVICE|MODE_APPEND|MODE_ENABLE_WRITE_AHEAD_LOGGING|MODE_MULTI_PROCESS|MODE_NO_LOCALIZED_COLLATORS|MODE_PRIVATE|MODE_WORLD_READABLE|MODE_WORLD_WRITEABLE|NETWORKMANAGEMENT_SERVICE|NETWORK_POLICY_SERVICE|NETWORK_SCORE_SERVICE|NETWORK_STATS_SERVICE|NFC_SERVICE|NOTIFICATION_SERVICE|NSD_SERVICE|OEM_LOCK_SERVICE|OVERLAY_SERVICE|PERSISTENT_DATA_BLOCK_SERVICE|POWER_SERVICE|PRINT_SERVICE|RADIO_SERVICE|RECEIVER_VISIBLE_TO_INSTANT_APPS|RECOVERY_SERVICE|RESTRICTIONS_SERVICE|SEARCH_SERVICE|SECURITY_SERVICE|SENSOR_SERVICE|SERIAL_SERVICE|SHORTCUT_SERVICE|SIP_SERVICE|SOUND_TRIGGER_SERVICE|STATUS_BAR_SERVICE|STORAGE_SERVICE|STORAGE_STATS_SERVICE|SYSTEM_HEALTH_SERVICE|TELECOM_SERVICE|TELEPHONY_SERVICE|TELEPHONY_SUBSCRIPTION_SERVICE|TEXT_CLASSIFICATION_SERVICE|TEXT_SERVICES_MANAGER_SERVICE|TRUST_SERVICE|TV_INPUT_SERVICE|UI_MODE_SERVICE|UPDATE_LOCK_SERVICE|USAGE_STATS_SERVICE|USB_SERVICE|USER_SERVICE|VIBRATOR_SERVICE|VOICE_INTERACTION_MANAGER_SERVICE|VR_SERVICE|WALLPAPER_SERVICE|WIFI_AWARE_SERVICE|WIFI_P2P_SERVICE|WIFI_RTT_SERVICE|WIFI_SCANNING_SERVICE|WIFI_SERVICE|WINDOW_SERVICE|TRIM_MEMORY_BACKGROUND|TRIM_MEMORY_COMPLETE|TRIM_MEMORY_MODERATE|TRIM_MEMORY_RUNNING_CRITICAL|TRIM_MEMORY_RUNNING_LOW|TRIM_MEMORY_RUNNING_MODERATE|TRIM_MEMORY_UI_HIDDEN";//mythoi
	private final static String extFunctionTarget="call|compile|dump|each|import|loadbitmap|loadlayout|loadmenu|set|task|thread|timer";
	private final static String functionTarget   = globalTarget+"|"+extFunctionTarget+"|"+packageName;
	private final static String keywordTarget= LuakeywordsTarget+"|"+JavaKeywordsTarget+"|"+XmlKeywordsTarget;
	private final static String[] keywords = keywordTarget.split("\\|");
	
	private final static String[] names = functionTarget.split("\\|");

	private final static char[] LUA_OPERATORS = {
		'(', ')', '{', '}', ',', ';', '=', '+', '-',
		'/', '*', '&', '!', '|', ':', '[', ']', '<', '>',
		'?', '~', '%', '^'
	};
	public static Language getInstance(){
		if(_theOne == null){
			_theOne = new LanguageLuaJava();
		}
		return _theOne;
	}
	
	private LanguageLuaJava(){
		
		System.out.println(names.length+"长度");
		super.setOperators(LUA_OPERATORS);
		super.setKeywords(keywords);
		super.setNames(names);
		super.addBasePackage("io",package_io.split("\\|"));
		super.addBasePackage("string",package_string.split("\\|"));
		super.addBasePackage("luajava",package_luajava.split("\\|"));
		super.addBasePackage("os",package_os.split("\\|"));
		super.addBasePackage("table",package_table.split("\\|"));
		super.addBasePackage("math",package_math.split("\\|"));
		super.addBasePackage("utf8",package_utf8.split("\\|"));
		super.addBasePackage("coroutine",package_coroutine.split("\\|"));
		super.addBasePackage("package",package_package.split("\\|"));
		super.addBasePackage("debug",package_debug.split("\\|"));
	//--	super.addBasePackage("activity",activity_method.split("\\|"));//mythoi
		}
	
	/**
	 * Whether the word after c is a token
	 */
	public boolean isWordStart2(char c){
		return (c=='.');
	}
	
	public boolean isLineAStart(char c){
		return false;
	}
	
	/**
	 * Whether c0c1L is a token, where L is a sequence of characters until the end of the line
	 */
	public boolean isLineStart(char c0, char c1){
		return (c0 == '-' && c1 == '-');
	}

	/**
	 * Whether c0c1 signifies the start of a multi-line token
	 */
	public boolean isMultilineStartDelimiter(char c0, char c1){
		return (c0 == '[' && c1 == '[');
	}

	/**
	 * Whether c0c1 signifies the end of a multi-line token
	 */
	public boolean isMultilineEndDelimiter(char c0, char c1){
		return (c0 == ']' && c1 == ']');
	}
	
}
